<?php

/**
 * BookNow form.
 *
 * @package    docplus.co.za
 * @subpackage form
 * @author     Fox Matuku
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class BookNowForm extends sfForm
{

    public function configure()
    {
        $this->widgetSchema['time_slot_id'] = new sfWidgetFormInputHidden();
        $this->widgetSchema['appointment_reason_id'] = new sfWidgetFormDoctrineChoice(array('model' => 'AppointmentReason', 'add_empty' => 'Please select a visit reason'), array('class' => 'select-box'));
        $this->widgetSchema['is_for_yourself'] = new sfWidgetFormChoice(array('choices' => array(1 => 'Myself', 2 => 'Someone else')), array('class' => 'select-box'));
        $this->widgetSchema['is_new_doctor'] = new sfWidgetFormChoice(array('choices' => array(1 => 'Yes, I\'ve seen this doctor before.', 2 => 'No, I haven\'t seen this doctor before')), array('class' => 'select-box'));
        $this->widgetSchema['is_using_insurance'] = new sfWidgetFormChoice(array('choices' => array(1 => 'Yes, I will use a medical insurance.', 2 => 'No, I\'m going to pay by cash')), array('class' => 'select-box'));

        $this->validatorSchema['time_slot_id'] = new sfValidatorString(array("required" => true), array("required" => "The time slot is missing"));
        $this->validatorSchema['appointment_reason_id'] = new sfValidatorDoctrineChoice(array('required' => true, 'model' => 'AppointmentReason'), array('required' => 'Your *visit reason* is required.'));
        $this->validatorSchema['is_for_yourself'] = new sfValidatorString(array('required' => false));
        $this->validatorSchema['is_new_doctor'] = new sfValidatorString(array('required' => false));
        $this->validatorSchema['is_using_insurance'] = new sfValidatorString(array('required' => false));

        $this->widgetSchema->setNameFormat('book_now[%s]');
    }

}
